package cn.wolfcode.service;

import cn.wolfcode.domain.Department;
import cn.wolfcode.domain.Employee;
import cn.wolfcode.qo.PageResult;
import cn.wolfcode.qo.QueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.apache.poi.ss.usermodel.Workbook;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

public interface IEmployeeService {

    void save(Employee employee, Long[] ids);

    void delete(Long id);

    void update(Employee employee, Long[] ids);

    Employee get(Long id);

    List<Employee> listAll();

    PageInfo<Employee> query(QueryObject qo);

    //登录
    Employee login(String username, String password);

    //修改密码
    Employee selectPassword(@Param("id") Long id, @Param("oldPassword") String oldPassword);

    //修改密码
    void updatePassword(@Param("id") Long id, @Param("newPassword") String newPassword);

    //批量删除
    void batchDelete(Long[] ids);

    Employee selectByName(String name);

    /**
     * 文件下载
     * @return
     */
    Workbook exportxls();

    /**
     * 文件上传
     * @param file
     */
    void importXls(MultipartFile file) throws IOException;

    /***
     * 根据角色编码查询员工
     * @return
     */

    List<Employee> selectByRoleSn(String... sns);
}